/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = t_frmodule_mng_init.c                              */
/*  NOTE      =                                                    */
/*  DATE      = 2014/12/19 by geyh                                 */
/*******************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <dlfcn.h>
#include <assert.h>
#include <CUnit/Basic.h>
#include <CUnit/CUnit.h>

#include "frcomm.h"
#include "frlog.h"
#include "frmem.h"
#include "frstr.h"
#include "frlist.h"
#include "frconfig.h"
#include "conntrack.h"
#include "frame_params.h"
#include "frame.h"
#include "module.h"
#include "frxml_parse.h"
#include "frmodule_stub.h"
#include "frmodule_mng.h"
#include "apmtest_cunit.h"
#include "frversion.h"

extern char g_arr_frame_version[30];

static int __suite_init(void)
{
	return 0;
}

static int __suite_cleanup(void)
{
	return 0;
}

extern Frlist_header *g_p_st_hdr_mng_module_use;
extern Frlist_header *g_p_st_hdr_mng_module_del;
extern pthread_t g_thread_id_chk;

static void case1(void)
{
    int i_ret = 0;
    i_ret = frmodule_mng_init();

    CU_ASSERT_EQUAL(i_ret,FR_SUCC);


    return;
}


int add_suite()
{
	CU_pSuite pSuite = NULL;

	pSuite = CU_add_suite("t_frmodule_mng_init 测试", __suite_init, __suite_cleanup);

	if (NULL == pSuite)
	{
		return 1;
	}


    //增加测试用例
   	CU_add_test(pSuite, "case1", case1);
  // 	CU_add_test(pSuite, "case2", case2);
 //  	CU_add_test(pSuite, "case3", case3);

    return 0;

}

int main(int argc, char **argv)
{
    fr_slab_init(52428800, "test");

    xmlInitParser();
    frversion_set(g_arr_frame_version, sizeof(g_arr_frame_version), 0);

    run_cunit(add_suite);

    xmlCleanupParser();
    fr_slab_destroy();
    return 0;
}